package data

import (
	"azfirewall-gateway/models"
	"encoding/json"
	"io/ioutil"
)

func NewConfig(filename string) (*models.Config, error) {
	config := new(models.Config)
	configBytes, err := ioutil.ReadFile(filename)
	if err != nil {
		return nil, err
	}
	_ = json.Unmarshal(configBytes, config)
	return config, nil
}
